import React, { Component } from "react";

import Data from "./data";

import {
    Link,
    BrowserRouter as Router,
    Route,
    Switch
} from "react-router-dom";

import People from "./people";


class LoveEducation extends Component {
    render() {
        return <div>
            <h1>这是爱的教育首页</h1>
            <h1><Link to="/loveEducationLogin">登录</Link></h1>
            <ul>
                {
                    Data.map((item,index)=>{
                       return <li key={index}><h1><Link to={{pathname:item.path,state:item.children}}>{item.name}</Link></h1></li>
                    })
                }
            </ul>
            <div>
                <Router>
                    <Switch>
                        <Route path="/loveEducation/people" component={People}></Route>
                    </Switch>
                </Router>
            </div>
        </div>
    }
}

class LoveEducatioinRouter extends Component {
    render() {
        return <Switch>

        </Switch>
    }
}

export default LoveEducation;